<%@ taglib prefix="s" uri="/struts-tags"%>
  <script>  
  $(document).ready(function() {
				
	  $("#frmUploadResource_imgUpload").change(function(){
		  $("#frmUploadResource_btnUpload").trigger('click');
		  	return false;
		  });
	  
	// Upload Start
	$("#frmUploadResource_btnUpload").click(function() {
		var options = {
				url : UPLOAD_FILE_URL,
				success : _uploadSuccess,

				type : 'post', // 'get' or 'post', override for form's 'method'
				dataType : 'json', // 'xml', 'script', or 'json' (expected server
				iframe : true
		};
		$('#frmUploadResource').ajaxSubmit(options);
		return false;
	});
	// Upload End	
				
				
  });

  </script>

<!-- Start: Upload file -->
	<script type="text/javascript"> 
	  
			function _uploadSuccess(responseText, statusText) {
				
			}		  
	</script>
	<form method="post" enctype="multipart/form-data" action="" name="frmUploadResource" id="frmUploadResource">		
		<fieldset>
			<h2>Upload</h2>
			<div>
				<s:file id="frmUploadResource_imgUpload" name="resourceFile"/>
				<button id="frmUploadResource_btnUpload">
					<span><s:text name="button.upload">UPLOAD</s:text></span>
				</button>
			</div>
			<br><br>
		</fieldset>		
	</form>

	<table>
		<tr>
			<td>
				<img id="viewImageUploaded" alt="" src="" width="60" height="60">
			</td>
		</tr>
	</table>
<!-- End: Upload file -->
